package database.local;

import android.content.Context;
import android.graphics.drawable.Drawable;
import app.ui.R;

public class PicturesUtil {
	
	public static final  int PUB = 1; 
	public static final  int REST = 2;
	public static final  int PARTY = 3;
	
	
	
	public static Drawable getBusinessPicBig (Business b, Context context){
		if (b.getType().equals("pub"))
			return context.getResources().getDrawable(R.drawable.pub_def_big);
		else if (b.getType().equals("rest"))
			return context.getResources().getDrawable(R.drawable.rest_def_big);
		else if (b.getType().equalsIgnoreCase("party"))
			return context.getResources().getDrawable(R.drawable.party_big);

		return context.getResources().getDrawable(R.drawable.default_big); 
	}
	
	public static Drawable getBusinessPicSmall (Business b, Context context){
		if (b.getType().equals("pub"))
			return context.getResources().getDrawable(R.drawable.pub_def_small);
		else if (b.getType().equals("rest"))
			return context.getResources().getDrawable(R.drawable.rest_def_small);
		else if (b.getType().equalsIgnoreCase("party"))
			return context.getResources().getDrawable(R.drawable.party_small);
		
		return context.getResources().getDrawable(R.drawable.default_small); 
	}
	
	public static Drawable getDealPicBig (Deal d, Context context){
		switch (d.getDeal_type()){
		case Deal.ASIAN_FOOD: return context.getResources().getDrawable(R.drawable.asian_big);
		case Deal.BEER: return context.getResources().getDrawable(R.drawable.beer_big);
		case Deal.BIRTHDAY: return context.getResources().getDrawable(R.drawable.birthday_big);
		case Deal.BREAKFAST: return context.getResources().getDrawable(R.drawable.breakfast_big);
		case Deal.CHASER: return context.getResources().getDrawable(R.drawable.chaser_big);
		case Deal.COCKTAIL: return context.getResources().getDrawable(R.drawable.cocktail_big);
		case Deal.DESSERT: return context.getResources().getDrawable(R.drawable.desseret_big);
		case Deal.HOT_DRINK: return context.getResources().getDrawable(R.drawable.hot_drink_big);
		case Deal.ITALIAN_FOOD: return context.getResources().getDrawable(R.drawable.italian_big);
		case Deal.MEAT: return context.getResources().getDrawable(R.drawable.meat_big);
		case Deal.PUB: return context.getResources().getDrawable(R.drawable.pub_def_big);
		case Deal.REST: return context.getResources().getDrawable(R.drawable.rest_def_big);
		case Deal.WINE: return context.getResources().getDrawable(R.drawable.wine_big);
		case Deal.PARTY: return context.getResources().getDrawable(R.drawable.party_big);
		default: return context.getResources().getDrawable(R.drawable.default_big);
		}
		}
		
		public static Drawable getDealPicSmall (Deal d, Context context){
			switch (d.getDeal_type()){
			case Deal.ASIAN_FOOD: return context.getResources().getDrawable(R.drawable.asian_small);
			case Deal.BEER: return context.getResources().getDrawable(R.drawable.beer_small);
			case Deal.BIRTHDAY: return context.getResources().getDrawable(R.drawable.birthday_small);
			case Deal.BREAKFAST: return context.getResources().getDrawable(R.drawable.breakfast_small);
			case Deal.CHASER: return context.getResources().getDrawable(R.drawable.chaser_small);
			case Deal.COCKTAIL: return context.getResources().getDrawable(R.drawable.cocktail_small);
			case Deal.DESSERT: return context.getResources().getDrawable(R.drawable.desseret_small);
			case Deal.HOT_DRINK: return context.getResources().getDrawable(R.drawable.hot_drink_small);
			case Deal.ITALIAN_FOOD: return context.getResources().getDrawable(R.drawable.italian_small);
			case Deal.MEAT: return context.getResources().getDrawable(R.drawable.meat_small);
			case Deal.PUB: return context.getResources().getDrawable(R.drawable.pub_def_small);
			case Deal.REST: return context.getResources().getDrawable(R.drawable.rest_def_small);
			case Deal.WINE: return context.getResources().getDrawable(R.drawable.wine_small);
			case Deal.PARTY: return context.getResources().getDrawable(R.drawable.party_small);
			default: return context.getResources().getDrawable(R.drawable.default_small);
			}
	}
		
		
		public static DrawableHolder getBusinessDrawableHodler(Deal d, int type, Context context){
			switch (type){

			case PUB:
				if (d.getSource_type().equalsIgnoreCase("auto"))
					return new DrawableHolder(context.getResources().getDrawable(R.drawable.drink1_system_icon_selected),
							context.getResources().getDrawable(R.drawable.drink1_system_icon));
				
				else
					return new DrawableHolder(context.getResources().getDrawable(R.drawable.drink1_user_icon_selected),
							context.getResources().getDrawable(R.drawable.drink1_user_icon)); 
			case REST:
				if (d.getSource_type().equalsIgnoreCase("auto"))
					return new DrawableHolder(context.getResources().getDrawable(R.drawable.eat1_system_icon_selected),
							context.getResources().getDrawable(R.drawable.eat1_system_icon));
				
				else
					return new DrawableHolder(context.getResources().getDrawable(R.drawable.eat1_user_icon_selected),
							context.getResources().getDrawable(R.drawable.eat1_user_icon));
			case PARTY:
				if (d.getSource_type().equalsIgnoreCase("auto"))
					return new DrawableHolder(context.getResources().getDrawable(R.drawable.party_map_system_selected),
							context.getResources().getDrawable(R.drawable.party_map_system));
				
				else
					return new DrawableHolder(context.getResources().getDrawable(R.drawable.party_map_user_selected),
							context.getResources().getDrawable(R.drawable.party_map_user));
			default :
				return new DrawableHolder(context.getResources().getDrawable(R.drawable.location_icon),
						context.getResources().getDrawable(R.drawable.location_icon));
			}
		}
	
		public static Drawable getUserDefaultPicBig (Context context){
			return context.getResources().getDrawable(R.drawable.user_default_big);
		}
		
		public static Drawable getDefaultPicSmall (Context context){
			return context.getResources().getDrawable(R.drawable.default_small);
		}

}
